<%-- 
    Document   : addresses
    Created on : Mar 31, 2012, 7:28:37 PM
    Author     : Apol
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%-- Header Area --%>
<%@ include file="/template/header.jsp" %> 
<%-- End of Header Area --%>

<%-- Content Area --%>
<h2>Addresses</h2>

<div class="submenu">
    <ul>
        <li><a href="/account/profile">Personal Information</a></li>
        <li><a href="/account/info">My Addresses</a></li>
        <li><a href="/account/history">Order History</a></li>
    </ul>
    <div class="clear"></div>
</div>
<div style="width: 650; margin: 0 auto;">
    <% for (Address a : addresses) {%>
    <div style="width: 300px; float: left;">
        <form method="POST" action="/account/modifyInfo"> 
            <fieldset>
                <legend><strong>Address Information</strong></legend>
                <table>
                    <input type="hidden" name="id" value="<%= a.getId()%>" />
                    <tr>
                        <td for="addTitle" align ="right">Address Title*</td> 
                        <td><input id="addTitle" type="text" name="addTitle" value="<%= a.getAddTitle()%>" validate="form" require="<b>Required Field Missing</b><br/>Please enter your preferred Alias." /></td>
                    </tr>
                    <tr>
                        <td for="address" align ="right">Address*</td> 
                        <td>
                            <textarea id="address" name="address" validate="form" require="<b>Required Field Missing</b><br/>Please enter the current location.">
                                <%= a.getAddress()%>
                            </textarea>
                        </td>
                    </tr>
                    <tr>
                        <td for="landmarks" align ="right">Landmarks</td> 
                        <td>
                            <textarea id="landmarks" name="landmarks">
                                <%= a.getLandmark()%>
                            </textarea>
                        </td
                    </tr>
                    <tr>
                        <td colspan="2" align="right">
                            <input type="submit" name="editAddress" value="Save" onclick="return validate('form');"/>
                            <input type="button" value="Reset" onclick="reload()" />
                            <input type="button" value="Delete" onclick="confirm('are you sure?') ? location.href='/account/removeInfo?id=<%= a.getId()%>' : ''"/>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </form>
    </div>
    <% }%>
    <div class="clear"></div>
    <a href="/account/addInfo">Add another Address</a>
</div>

<%@ include file="/template/footer.jsp" %> 
